package service;

import model.Teacher;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

@Service
public class TeacherService {
    private TeacherDao dao;

    @Autowired
    public void setTeacherDao(TeacherDao dao){
        this.dao=dao;
    }
    public boolean deleteTeacher(String tno){
        return dao.deleteTeacher(tno)>0;
    }
    public ArrayList<Teacher> getTeacher(String tname){
        return dao.findTeacherByTname(tname);
    }
    public ArrayList<Teacher> getAllTeachers(){
        return dao.getAllTeachers();
    }
    public boolean editTeacher(Teacher teacher){
        return dao.editTeacher(teacher)>0;
    }
    public boolean addTeacher(Teacher teacher){
        return  dao.addTeacher(teacher)>0;
    }

}
